{% extends 'layout.html' %}
{% block content %}
<div class="bs-example" data-example-id="table-within-panel">
    <div style="margin-bottom: 10px">
         <a href="/city/add/" class="btn btn-primary btn-success">新建城市</a>
    </div>
    <div class="panel panel-default">
        <div class="panel-heading">
            <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
            城市列表
        </div>
        <table class="table  table-bordered">
            <thead>
            <tr>
                <th>ID</th>
                <th>logo</th>
                <th>名称</th>
                <th>人口</th>
            </tr>
            </thead>
            <tbody>
            {% for obj in data_list %}
            <tr>
                <td>{{obj.id}}</td>
                <td><img src="/media/{{obj.img}}" alt="" style="width:100px;height:80px;"></td>
                <td>{{obj.name}}</td>
                <td>{{obj.count}}</td>
            </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
</div>
{% endblock %}